﻿/*
 * 
 *	C# object representation of row in 'researchRepo.universityDepartments' table:
 *	
 *	Currently a simple mapping of all table columns to equivalent properties,
 *	though the class might be expanded to track appropriate relationships with other tables.
 * 
 */

namespace ResearchRepository.Models
{
	public class RRUniversityDepartment
	{
		public RRUniversityDepartment(int dID, int uID, string dName)
		{
			DeptId = dID;
			UnivId = uID;
			DeptName = dName;
		}
		public RRUniversityDepartment(RRUniversityDepartment source)
			:this(source.DeptId,
					source.UnivId,
					source.DeptName)
		{}
		public RRUniversityDepartment(System.Data.IDataRecord source)
			:this((int) source["deptID"],
					(int) source["univID"],
					(string) source["deptName"])
		{}

		// named alias for constructor, provides handle to simulate a function pointer to constructor
		public static RRUniversityDepartment construct(System.Data.IDataRecord source)
		{
			return new RRUniversityDepartment(source);
		}

		public int DeptId { get; set; }
		public int UnivId { get; set; }
		public string DeptName { get; set; }
	}
}